# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataflow.V1b3.Model.LaunchFlexTemplateParameter do
  @moduledoc """
  Launch FlexTemplate Parameter.

  ## Attributes

  *   `containerSpec` (*type:* `GoogleApi.Dataflow.V1b3.Model.ContainerSpec.t`, *default:* `nil`) - Spec about the container image to launch.
  *   `containerSpecGcsPath` (*type:* `String.t`, *default:* `nil`) - Cloud Storage path to a file with json serialized ContainerSpec as content.
  *   `environment` (*type:* `GoogleApi.Dataflow.V1b3.Model.FlexTemplateRuntimeEnvironment.t`, *default:* `nil`) - The runtime environment for the FlexTemplate job
  *   `jobName` (*type:* `String.t`, *default:* `nil`) - Required. The job name to use for the created job. For update job request, job name should be same as the existing running job.
  *   `launchOptions` (*type:* `map()`, *default:* `nil`) - Launch options for this flex template job. This is a common set of options across languages and templates. This should not be used to pass job parameters.
  *   `parameters` (*type:* `map()`, *default:* `nil`) - The parameters for FlexTemplate. Ex. {"num_workers":"5"}
  *   `transformNameMappings` (*type:* `map()`, *default:* `nil`) - Use this to pass transform_name_mappings for streaming update jobs. Ex:{"oldTransformName":"newTransformName",...}'
  *   `update` (*type:* `boolean()`, *default:* `nil`) - Set this to true if you are sending a request to update a running streaming job. When set, the job name should be the same as the running job.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :containerSpec => GoogleApi.Dataflow.V1b3.Model.ContainerSpec.t() | nil,
          :containerSpecGcsPath => String.t() | nil,
          :environment => GoogleApi.Dataflow.V1b3.Model.FlexTemplateRuntimeEnvironment.t() | nil,
          :jobName => String.t() | nil,
          :launchOptions => map() | nil,
          :parameters => map() | nil,
          :transformNameMappings => map() | nil,
          :update => boolean() | nil
        }

  field(:containerSpec, as: GoogleApi.Dataflow.V1b3.Model.ContainerSpec)
  field(:containerSpecGcsPath)
  field(:environment, as: GoogleApi.Dataflow.V1b3.Model.FlexTemplateRuntimeEnvironment)
  field(:jobName)
  field(:launchOptions, type: :map)
  field(:parameters, type: :map)
  field(:transformNameMappings, type: :map)
  field(:update)
end

defimpl Poison.Decoder, for: GoogleApi.Dataflow.V1b3.Model.LaunchFlexTemplateParameter do
  def decode(value, options) do
    GoogleApi.Dataflow.V1b3.Model.LaunchFlexTemplateParameter.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataflow.V1b3.Model.LaunchFlexTemplateParameter do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
